<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>

<%
    // 数据库连接信息
    String url = "jdbc:sqlserver://localhost:1433;databaseName=mydb";
    String username = "sa";
    String password = "1";

    // 尝试连接数据库

    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    Connection conn = DriverManager.getConnection(url, username, password);
   // out.print("success!");
    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    //stmt.executeUpdate(sql);
    //ResultSet rst=stmt.executeQuery(sql);
    %>